fac 0 = 1
fac n = n * fac (n-1)

main = do putStrLn "Enter a number to be factored" 
          x <- readLn
          print (fac x)